package com.ufenlei.alarm
{
	public class AlarmTime
	{
		private var is_period:Boolean;
		private var _time:Number;
		
		public function AlarmTime(t:Number, isPeriod:Boolean = false):void{
			is_period = isPeriod;
			this._time = t;
		}
		public function get isPeriod ():Boolean{
			return is_period;
		}
		public function get time():Number{
			return this._time;
		}
		public function toDate():Date{
			var d:Date = new Date();
			return is_period?new Date(d.time + _time) : new Date(_time);
		}
		public function toString():String{
			if(is_period){
				var tp:TimePeriod = new TimePeriod(_time);
				return tp.getPeriod();
			}else{
				return this.toDate().toLocaleString();
			}
		}
	}
}